package com.marry.contract.provider;

import com.marry.contract.vo.MenuVo;
import com.marry.contract.vo.RoleVo;
import com.marry.contract.vo.SysUser;
import com.marry.core.annotation.webflux.WebFluxClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * @path：com.marry.contract.provider.UserApi.java
 * @className：UserApi.java
 * @description：TODO
 * @author：LiuYun
 * @dateTime：2021/7/4 15:09
 * @editNote：
 */
@WebFluxClient(value = "http://localhost:8082/")
@RequestMapping("/user")
public interface UserApi {

    @PostMapping("/findByName/{userName}")
    Mono<SysUser> findByName(@PathVariable("userName") String userName);

    @PostMapping("/getRolePermission/{roleId}")
    Flux<MenuVo> getRolePermission(@PathVariable("roleId") String roleId);

    @PostMapping("/getRoleByUserId/{userId}")
    Flux<RoleVo> getRoleByUserId(@PathVariable("userId") String userId);
}
